<template>
  <div>
    <ul>
      <li>土豆</li>
      <li>
        <router-link to="/fooddetail?id=10001&name=yam"> 山药 </router-link>
      </li>
      <li>鸡肉</li>
    </ul>
    <p>
      count1 is {{ count1 }}
      <button @click="count1++">+</button>
    </p>
  </div>
</template>

<script>
export default {
  data () {
    return {
      count1: 100
    }
  },
  // 当前能看到它了
  activated () {
    console.log('---FoodsList---activated')
  },
  // 失活，只是暂时看不到，没有销毁
  deactivated () {
    console.log('---FoodsList---deactivated')
  },
  beforeDestroy () {
    console.log('---FoodsList---beforeDestroy')
  },
  destroyed () {
    console.log('---FoodsList---destroyed')
  }
}
</script>
